package edu.ustb.spring.test;

import java.lang.reflect.Method;

import org.apache.log4j.Logger;
import org.springframework.aop.AfterReturningAdvice;

/**
 * 后置通知
 * @author lijia
 *
 */
public class AfterLogAdvice implements AfterReturningAdvice {
	
	Logger logger = Logger.getLogger(AfterLogAdvice.class);
	
	@Override
	public void afterReturning(Object returnValue, Method method, Object[] args,
			Object target) throws Throwable {
		String className = target.getClass().getName();
		String methodName = method.getName();
//		String returnClass = returnValue.getClass().getName();
		String message = "后置通知："+className+" 类的 " + methodName +" 方法已经执行 ";
		logger.info(message);
	}

}
